<?php
namespace Admin\Controller;
use Think\Controller;
class CountController extends CommonController {
    public function ques(){

        var_dump($_SESSION);

        $aid = $_SESSION['aid'];
        $path = MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME;

        var_dump($path);


        $auth=new \Think\Auth();  
        $res = $auth->check($path,$aid);

        var_dump($res);

    	$sql ="select count(*) num,from_unixtime(ctime, '%m-%d') cdate from question group by cdate";

    	$data = M()->query($sql);


    	$date = '';

    	$num = '';

    	foreach ($data as $row) {
    		$date .="'".$row['cdate']."',";
    		$num .= $row['num'].',';

    	}

    	$date = rtrim($date,',');

    	$num = rtrim($num,',');

    	$this->assign('date',$date);
    	$this->assign('num',$num);
        $this->display();
    }
}